// Defines buffs
//--------------------------------
#ifndef BUFFS_H
#define BUFFS_H
#include "buff.h"
#include "bcreature.h"
#include "bspecial.h"
#include "bitem.h"

enum BuffStackCategory {
    STACK_ON_FIRE = 1,
    STACK_CHARRED,
    STACK_UNIDENTIFIED
};

class StatsBuff : public Buff, public BIStats {
public:

    StatsBuff( int hpMax = 0, int mpMax = 0, int sStr = 0, int sDex = 0, int sInt = 0,
               int ac = 0, int magicRes = 0, int fireRes = 0 );
    virtual ~StatsBuff() { }

protected:

    virtual bool Stats( int* hpMax, int* mpMax, int* sStr, int* sDex, int* sInt,
                        int* ac, int* magicRes, int* fireRes ) const;

private:

    int _hpMax, _mpMax, _sStr, _sDex, _sInt, _ac, _magicRes, _fireRes;

};

class DerivedStatsBuff : public Buff, public BIDerivedStats {
public:

    DerivedStatsBuff( double hpRegen = 0.0, double mpRegen = 0.0, int weightMax = 0.0 );
    virtual ~DerivedStatsBuff() { }

protected:

    virtual bool DerivedStats( double* hpRegen, double* mpRegen, int* weightMax ) const;

private:

    double _hpRegen, _mpRegen;
    int _weightMax;

};

class OnFireBuff : public Buff, public BIPriority, public BIFire, public BIName, public BILight, public BISymbol, public BIStatusEffects,
                   public BICreateWieldBuff, public BICreateWearBuff, public BICreateHoldBuff, public BIOnSetFire,
                   public BIFlammable, public BIOnLight {
public:

    OnFireBuff();
    virtual ~OnFireBuff() { }

protected:

    virtual bool OnTick();
    virtual bool Priority( int* priority ) const;
    virtual bool Fire( uint* fireType ) const;
    virtual bool Name( std::string* name, bool* plural, uint article ) const;
    virtual bool Light( int* lightRange ) const;
    virtual bool StatusEffects( StatusEffectList* list ) const;
    virtual bool Symbol( IO::SymList* list ) const;
    virtual bool CreateWieldBuff( CompoundBuff** buff ) const;
    virtual bool CreateWearBuff( CompoundBuff** buff ) const;
    virtual bool CreateHoldBuff( CompoundBuff** buff ) const;
    virtual bool OnSetFire();
    virtual bool Flammable( uint* flammableType ) const;
    virtual bool OnLight( Creature* c, Behaved* target );

    virtual void OnBuffApply();
    virtual void OnBuffExpire();

};

class SmoulderingBuff : public Buff, public BIPriority, public BIFire, public BIName, public BILight, public BISymbol, public BIStatusEffects,
                        public BICreateWieldBuff, public BICreateWearBuff, public BICreateHoldBuff, public BIOnSetFire {
public:

    SmoulderingBuff();
    virtual ~SmoulderingBuff() { }

protected:

    virtual bool Priority( int* priority ) const;
    virtual bool Fire( uint* fireType ) const;
    virtual bool Name( std::string* name, bool* plural, uint article ) const;
    virtual bool Light( int* lightRange ) const;
    virtual bool StatusEffects( StatusEffectList* list ) const;
    virtual bool Symbol( IO::SymList* list ) const;
    virtual bool CreateWieldBuff( CompoundBuff** buff ) const;
    virtual bool CreateWearBuff( CompoundBuff** buff ) const;
    virtual bool CreateHoldBuff( CompoundBuff** buff ) const;
    virtual bool OnSetFire();

    virtual void OnBuffApply();
    virtual void OnBuffExpire();

};

class CharredBuff : public Buff, public BIPriority, public BIFire, public BIName, public BISymbol, public BIStatusEffects,
                    public BICreateWieldBuff, public BICreateWearBuff, public BICreateHoldBuff, public BIOnSetFire {
public:

    CharredBuff();
    virtual ~CharredBuff() { }

protected:

    virtual bool Priority( int* priority ) const;
    virtual bool Fire( uint* fireType ) const;
    virtual bool Name( std::string* name, bool* plural, uint article ) const;
    virtual bool StatusEffects( StatusEffectList* list ) const;
    virtual bool Symbol( IO::SymList* list ) const;
    virtual bool CreateWieldBuff( CompoundBuff** buff ) const;
    virtual bool CreateWearBuff( CompoundBuff** buff ) const;
    virtual bool CreateHoldBuff( CompoundBuff** buff ) const;
    virtual bool OnSetFire();

    virtual void OnBuffApply();

};

class LightRadiusBuff : public Buff, public BILight {
public:

    LightRadiusBuff( int radius );
    virtual ~LightRadiusBuff() { }

protected:

    virtual bool Light( int* lightRange ) const;

private:

    int _radius;

};

class UnidentifiedBuff : public Buff, public BIOnIdentify, public BIName, public BIItemSymbol {
public:

    UnidentifiedBuff();
    virtual ~UnidentifiedBuff() { }

protected:

    virtual bool OnIdentify();

};

#endif
